package com.example.nio;

import com.example.nio.component.ChatServerApplication;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
public class NioServerApplication {
    public static final Logger logger = LoggerFactory.getLogger(NioServerApplication.class);

    public static void main(String[] args) throws InterruptedException {
        logger.info("SpringBoot开始加载");
        ConfigurableApplicationContext context = SpringApplication.run(NioServerApplication.class, args);
        logger.info("SpringBoot加载完毕");
        ChatServerApplication chatServerApplication = context.getBean(ChatServerApplication.class);
        chatServerApplication.start();
    }

}
